package com.drugstore.drugstore.service.impl;

import com.drugstore.drugstore.domain.Medicine;
import com.drugstore.drugstore.mapper.MedicineMapper;
import com.drugstore.drugstore.service.IMedicineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Service业务层处理
 * 
 * @author 
 * @date 2025-05-08
 */
@Service
public class MedicineServiceImpl implements IMedicineService
{
    @Autowired
    private MedicineMapper medicineMapper;

    /**
     * 查询
     * 
     * @param id 主键
     * @return 
     */
    @Override
    public Medicine selectMedicineById(Long id)
    {
        return medicineMapper.selectMedicineById(id);
    }

    /**
     * 查询列表
     * 
     * @param medicine 
     * @return 
     */
    @Override
    public List<Medicine> selectMedicineList(Medicine medicine)
    {
        return medicineMapper.selectMedicineList(medicine);
    }

    /**
     * 新增
     * 
     * @param medicine 
     * @return 结果
     */
    @Override
    public int insertMedicine(Medicine medicine)
    {
        return medicineMapper.insertMedicine(medicine);
    }

    /**
     * 修改
     * 
     * @param medicine 
     * @return 结果
     */
    @Override
    public int updateMedicine(Medicine medicine)
    {
        return medicineMapper.updateMedicine(medicine);
    }

    /**
     * 批量删除
     * 
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteMedicineByIds(Long[] ids)
    {
        return medicineMapper.deleteMedicineByIds(ids);
    }

    /**
     * 删除信息
     * 
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteMedicineById(Long id)
    {
        return medicineMapper.deleteMedicineById(id);
    }
}
